/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.spend.service;

import me.zhengjie.modules.spend.domain.Spend;
import me.zhengjie.modules.spend.service.dto.SpendDto;
import me.zhengjie.modules.spend.service.dto.SpendQueryCriteria;
import me.zhengjie.modules.system.domain.DictDetail;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;

/**
* @website https://el-admin.vip
* @description 服务接口
* @author yyj
* @date 2022-04-08
**/
public interface SpendService {

    /**
    * 查询数据分页
    * @param criteria 条件
    * @param pageable 分页参数
    * @return Map<String,Object>
    */
    Map<String,Object> queryAll(SpendQueryCriteria criteria, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param criteria 条件参数
    * @return List<SpendDto>
    */
    List<SpendDto> queryAll(SpendQueryCriteria criteria);

    /**
     * 根据ID查询
     * @param id ID
     * @return SpendDto
     */
    SpendDto findById(String id);

    /**
    * 创建
    * @param resources /
    * @return SpendDto
    */
    SpendDto create(Spend resources);

    /**
    * 编辑
    * @param resources /
    */
    void update(Spend resources);

    /**
    * 多选删除
    * @param ids /
    */
    void deleteAll(String[] ids);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    void download(List<SpendDto> all, HttpServletResponse response) throws IOException;


    /**
     * 消费额
     * @return
     */

    List<Map<Object,Object>>everyMonth(Integer dateNum);


    /**
     * 批量导入信息
     * @param file
     * @return
     */

    Map<String, Object> upload(MultipartFile file) throws IOException;


    /**
     * 导出模板
     * @param response
     * @throws IOException
     */
    void exportTemplate(HttpServletResponse response) throws IOException;


    List<Spend> getData();


    List<Map<Object,Object>> getPayTypeNum(String type);

    List<Map<Object,Object>> getSpendTypeNum(String type);

    Integer getYearPriceSum(String year);

    List<Map<Object, Object>> monthDateList(Integer numMonth);

    List<String> getSpendLabel();

    Map<String,Object> countNumberByDate(String dates);

    void orginToDesnate();

}